﻿<ctrl:GuiControl x:Class="CannedBytes.CommandLineGui.UI.Controls.GroupDisplayControl" x:ClassModifier="internal"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:ctrl="clr-namespace:CannedBytes.CommandLineGui.UI.Controls"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="300"
             ToolTip="{Binding Description, Mode=OneTime}">

    <ScrollViewer VerticalScrollBarVisibility="Auto">
        <Grid Name="LayoutGrid" Grid.IsSharedSizeScope="True">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <ctrl:Help DataContext="{Binding Path=HelpInfo, Mode=OneTime}"
                   Grid.ColumnSpan="3" HorizontalAlignment="Right" />

            <GroupBox Name="GroupDisplayLabel" Header="{Binding Path=Name, Mode=OneTime}"
                  Grid.Row="1" Grid.ColumnSpan="3" Grid.RowSpan="2"
                  Visibility="{Binding ShowGroupName, Mode=OneTime, Converter={StaticResource BoolToVisibilityConverter}}"/>

            <ItemsControl Name="GroupDisplayList" Margin="2,18,2,2"
                    ItemsSource="{Binding Path=Bindings, Mode=OneTime}" ItemTemplateSelector="{StaticResource ControlTemplateSelector}"
                    Grid.Row="1" Grid.ColumnSpan="3" Grid.RowSpan="2" />
        </Grid>
    </ScrollViewer>
</ctrl:GuiControl>